﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Text.RegularExpressions;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria.ModLoader.IO;
using Terraria.Utilities;

namespace Terraria.ModLoader
{
	// Token: 0x020001DB RID: 475
	public class ModItem
	{
		// Token: 0x1700016D RID: 365
		// (get) Token: 0x06001383 RID: 4995 RVA: 0x0000FFCC File Offset: 0x0000E1CC
		// (set) Token: 0x06001384 RID: 4996 RVA: 0x0000FFD4 File Offset: 0x0000E1D4
		public Item item { get; internal set; }

		// Token: 0x1700016E RID: 366
		// (get) Token: 0x06001385 RID: 4997 RVA: 0x0000FFDD File Offset: 0x0000E1DD
		// (set) Token: 0x06001386 RID: 4998 RVA: 0x0000FFE5 File Offset: 0x0000E1E5
		public Mod mod { get; internal set; }

		// Token: 0x1700016F RID: 367
		// (get) Token: 0x06001387 RID: 4999 RVA: 0x0000FFEE File Offset: 0x0000E1EE
		// (set) Token: 0x06001388 RID: 5000 RVA: 0x0000FFF6 File Offset: 0x0000E1F6
		public string Name { get; internal set; }

		// Token: 0x17000170 RID: 368
		// (get) Token: 0x06001389 RID: 5001 RVA: 0x0000FFFF File Offset: 0x0000E1FF
		// (set) Token: 0x0600138A RID: 5002 RVA: 0x00010007 File Offset: 0x0000E207
		public ModTranslation DisplayName { get; internal set; }

		// Token: 0x17000171 RID: 369
		// (get) Token: 0x0600138B RID: 5003 RVA: 0x00010010 File Offset: 0x0000E210
		// (set) Token: 0x0600138C RID: 5004 RVA: 0x00010018 File Offset: 0x0000E218
		public ModTranslation Tooltip { get; internal set; }

		// Token: 0x17000172 RID: 370
		// (get) Token: 0x0600138D RID: 5005 RVA: 0x00010021 File Offset: 0x0000E221
		public virtual string Texture
		{
			get
			{
				return (base.GetType().Namespace + "." + this.Name).Replace('.', '/');
			}
		}

		// Token: 0x0600138E RID: 5006 RVA: 0x00010047 File Offset: 0x0000E247
		public ModItem()
		{
			this.item = new Item
			{
				modItem = this
			};
		}

		// Token: 0x0600138F RID: 5007 RVA: 0x00010061 File Offset: 0x0000E261
		public virtual bool Autoload(ref string name)
		{
			return this.mod.Properties.Autoload;
		}

		// Token: 0x17000173 RID: 371
		// (get) Token: 0x06001390 RID: 5008 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool CloneNewInstances
		{
			get
			{
				return false;
			}
		}

		// Token: 0x06001391 RID: 5009 RVA: 0x00010073 File Offset: 0x0000E273
		public virtual ModItem Clone()
		{
			return (ModItem)base.MemberwiseClone();
		}

		// Token: 0x06001392 RID: 5010 RVA: 0x00010080 File Offset: 0x0000E280
		public virtual ModItem Clone(Item item)
		{
			return this.NewInstance(item);
		}

		// Token: 0x06001393 RID: 5011 RVA: 0x00410D80 File Offset: 0x0040EF80
		public virtual ModItem NewInstance(Item itemClone)
		{
			if (this.CloneNewInstances)
			{
				ModItem modItem = this.Clone();
				modItem.item = itemClone;
				return modItem;
			}
			ModItem modItem2 = (ModItem)Activator.CreateInstance(base.GetType());
			modItem2.item = itemClone;
			modItem2.mod = this.mod;
			modItem2.Name = this.Name;
			modItem2.projOnSwing = this.projOnSwing;
			modItem2.bossBagNPC = this.bossBagNPC;
			return modItem2;
		}

		// Token: 0x06001394 RID: 5012 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void SetDefaults()
		{
		}

		// Token: 0x06001395 RID: 5013 RVA: 0x00010089 File Offset: 0x0000E289
		public virtual void AutoDefaults()
		{
			EquipLoader.SetSlot(this.item);
		}

		// Token: 0x06001396 RID: 5014 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void SetStaticDefaults()
		{
		}

		// Token: 0x06001397 RID: 5015 RVA: 0x00410DF0 File Offset: 0x0040EFF0
		public virtual void AutoStaticDefaults()
		{
			Main.itemTexture[this.item.type] = ModLoader.GetTexture(this.Texture);
			string name = this.Texture + "_Flame";
			if (ModLoader.TextureExists(name))
			{
				Main.itemFlameTexture[this.item.type] = ModLoader.GetTexture(name);
				Main.itemFlameLoaded[this.item.type] = true;
			}
			if (this.DisplayName.IsDefault())
			{
				this.DisplayName.SetDefault(Regex.Replace(this.Name, "([A-Z])", " $1").Trim());
			}
		}

		// Token: 0x06001398 RID: 5016 RVA: 0x0000EAB6 File Offset: 0x0000CCB6
		public virtual int ChoosePrefix(UnifiedRandom rand)
		{
			return -1;
		}

		// Token: 0x06001399 RID: 5017 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool CanUseItem(Player player)
		{
			return true;
		}

		// Token: 0x0600139A RID: 5018 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UseStyle(Player player)
		{
		}

		// Token: 0x0600139B RID: 5019 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void HoldStyle(Player player)
		{
		}

		// Token: 0x0600139C RID: 5020 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void HoldItem(Player player)
		{
		}

		// Token: 0x0600139D RID: 5021 RVA: 0x0000EAB9 File Offset: 0x0000CCB9
		public virtual float UseTimeMultiplier(Player player)
		{
			return 1f;
		}

		// Token: 0x0600139E RID: 5022 RVA: 0x0000EAB9 File Offset: 0x0000CCB9
		public virtual float MeleeSpeedMultiplier(Player player)
		{
			return 1f;
		}

		// Token: 0x0600139F RID: 5023 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void GetWeaponDamage(Player player, ref int damage)
		{
		}

		// Token: 0x060013A0 RID: 5024 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void GetWeaponKnockback(Player player, ref float knockback)
		{
		}

		// Token: 0x060013A1 RID: 5025 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void GetWeaponCrit(Player player, ref int crit)
		{
		}

		// Token: 0x060013A2 RID: 5026 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback)
		{
		}

		// Token: 0x060013A3 RID: 5027 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool ConsumeAmmo(Player player)
		{
			return true;
		}

		// Token: 0x060013A4 RID: 5028 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void OnConsumeAmmo(Player player)
		{
		}

		// Token: 0x060013A5 RID: 5029 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
		{
			return true;
		}

		// Token: 0x060013A6 RID: 5030 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox)
		{
		}

		// Token: 0x060013A7 RID: 5031 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void MeleeEffects(Player player, Rectangle hitbox)
		{
		}

		// Token: 0x060013A8 RID: 5032 RVA: 0x00404F84 File Offset: 0x00403184
		public virtual bool? CanHitNPC(Player player, NPC target)
		{
			return null;
		}

		// Token: 0x060013A9 RID: 5033 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void ModifyHitNPC(Player player, NPC target, ref int damage, ref float knockBack, ref bool crit)
		{
		}

		// Token: 0x060013AA RID: 5034 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
		{
		}

		// Token: 0x060013AB RID: 5035 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool CanHitPvp(Player player, Player target)
		{
			return true;
		}

		// Token: 0x060013AC RID: 5036 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void ModifyHitPvp(Player player, Player target, ref int damage, ref bool crit)
		{
		}

		// Token: 0x060013AD RID: 5037 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void OnHitPvp(Player player, Player target, int damage, bool crit)
		{
		}

		// Token: 0x060013AE RID: 5038 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool UseItem(Player player)
		{
			return false;
		}

		// Token: 0x060013AF RID: 5039 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool ConsumeItem(Player player)
		{
			return true;
		}

		// Token: 0x060013B0 RID: 5040 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void OnConsumeItem(Player player)
		{
		}

		// Token: 0x060013B1 RID: 5041 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool UseItemFrame(Player player)
		{
			return false;
		}

		// Token: 0x060013B2 RID: 5042 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool HoldItemFrame(Player player)
		{
			return false;
		}

		// Token: 0x060013B3 RID: 5043 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool AltFunctionUse(Player player)
		{
			return false;
		}

		// Token: 0x060013B4 RID: 5044 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UpdateInventory(Player player)
		{
		}

		// Token: 0x060013B5 RID: 5045 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UpdateEquip(Player player)
		{
		}

		// Token: 0x060013B6 RID: 5046 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UpdateAccessory(Player player, bool hideVisual)
		{
		}

		// Token: 0x060013B7 RID: 5047 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UpdateVanity(Player player, EquipType type)
		{
		}

		// Token: 0x060013B8 RID: 5048 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool IsArmorSet(Item head, Item body, Item legs)
		{
			return false;
		}

		// Token: 0x060013B9 RID: 5049 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UpdateArmorSet(Player player)
		{
		}

		// Token: 0x060013BA RID: 5050 RVA: 0x00410E90 File Offset: 0x0040F090
		public virtual bool IsVanitySet(int head, int body, int legs)
		{
			Item item = new Item();
			if (head >= 0)
			{
				item.SetDefaults(Item.headType[head], true);
			}
			Item item2 = new Item();
			if (body >= 0)
			{
				item2.SetDefaults(Item.bodyType[body], true);
			}
			Item item3 = new Item();
			if (legs >= 0)
			{
				item3.SetDefaults(Item.legType[legs], true);
			}
			return this.IsArmorSet(item, item2, item3);
		}

		// Token: 0x060013BB RID: 5051 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PreUpdateVanitySet(Player player)
		{
		}

		// Token: 0x060013BC RID: 5052 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UpdateVanitySet(Player player)
		{
		}

		// Token: 0x060013BD RID: 5053 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void ArmorSetShadows(Player player)
		{
		}

		// Token: 0x060013BE RID: 5054 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void SetMatch(bool male, ref int equipSlot, ref bool robes)
		{
		}

		// Token: 0x060013BF RID: 5055 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool CanRightClick()
		{
			return false;
		}

		// Token: 0x060013C0 RID: 5056 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void RightClick(Player player)
		{
		}

		// Token: 0x060013C1 RID: 5057 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void OpenBossBag(Player player)
		{
		}

		// Token: 0x060013C2 RID: 5058 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool ReforgePrice(ref int reforgePrice, ref bool canApplyDiscount)
		{
			return true;
		}

		// Token: 0x060013C3 RID: 5059 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool NewPreReforge()
		{
			return true;
		}

		// Token: 0x060013C4 RID: 5060 RVA: 0x00010096 File Offset: 0x0000E296
		[Obsolete("PreReforge now returns a bool to control whether the reforge takes place. For now, use NewPreReforge")]
		public virtual void PreReforge()
		{
			ModItem modItem = this.item.modItem;
			if (modItem == null)
			{
				return;
			}
			modItem.NewPreReforge();
		}

		// Token: 0x060013C5 RID: 5061 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PostReforge()
		{
		}

		// Token: 0x060013C6 RID: 5062 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void DrawHands(ref bool drawHands, ref bool drawArms)
		{
		}

		// Token: 0x060013C7 RID: 5063 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void DrawHair(ref bool drawHair, ref bool drawAltHair)
		{
		}

		// Token: 0x060013C8 RID: 5064 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool DrawHead()
		{
			return true;
		}

		// Token: 0x060013C9 RID: 5065 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool DrawBody()
		{
			return true;
		}

		// Token: 0x060013CA RID: 5066 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool DrawLegs()
		{
			return true;
		}

		// Token: 0x060013CB RID: 5067 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void DrawArmorColor(Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor)
		{
		}

		// Token: 0x060013CC RID: 5068 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void ArmorArmGlowMask(Player drawPlayer, float shadow, ref int glowMask, ref Color color)
		{
		}

		// Token: 0x060013CD RID: 5069 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
		{
		}

		// Token: 0x060013CE RID: 5070 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration)
		{
		}

		// Token: 0x060013CF RID: 5071 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool WingUpdate(Player player, bool inUse)
		{
			return false;
		}

		// Token: 0x060013D0 RID: 5072 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void Update(ref float gravity, ref float maxFallSpeed)
		{
		}

		// Token: 0x060013D1 RID: 5073 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PostUpdate()
		{
		}

		// Token: 0x060013D2 RID: 5074 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void GrabRange(Player player, ref int grabRange)
		{
		}

		// Token: 0x060013D3 RID: 5075 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool GrabStyle(Player player)
		{
			return false;
		}

		// Token: 0x060013D4 RID: 5076 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool CanPickup(Player player)
		{
			return true;
		}

		// Token: 0x060013D5 RID: 5077 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool OnPickup(Player player)
		{
			return true;
		}

		// Token: 0x060013D6 RID: 5078 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool ItemSpace(Player player)
		{
			return false;
		}

		// Token: 0x060013D7 RID: 5079 RVA: 0x00404FFC File Offset: 0x004031FC
		public virtual Color? GetAlpha(Color lightColor)
		{
			return null;
		}

		// Token: 0x060013D8 RID: 5080 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
		{
			return true;
		}

		// Token: 0x060013D9 RID: 5081 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
		{
		}

		// Token: 0x060013DA RID: 5082 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
		{
			return true;
		}

		// Token: 0x060013DB RID: 5083 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
		{
		}

		// Token: 0x060013DC RID: 5084 RVA: 0x00405014 File Offset: 0x00403214
		public virtual Vector2? HoldoutOffset()
		{
			return null;
		}

		// Token: 0x060013DD RID: 5085 RVA: 0x00405014 File Offset: 0x00403214
		public virtual Vector2? HoldoutOrigin()
		{
			return null;
		}

		// Token: 0x060013DE RID: 5086 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool CanEquipAccessory(Player player, int slot)
		{
			return true;
		}

		// Token: 0x060013DF RID: 5087 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void ExtractinatorUse(ref int resultType, ref int resultStack)
		{
		}

		// Token: 0x060013E0 RID: 5088 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void AutoLightSelect(ref bool dryTorch, ref bool wetTorch, ref bool glowstick)
		{
		}

		// Token: 0x060013E1 RID: 5089 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void CaughtFishStack(ref int stack)
		{
		}

		// Token: 0x060013E2 RID: 5090 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool IsQuestFish()
		{
			return false;
		}

		// Token: 0x060013E3 RID: 5091 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool IsAnglerQuestAvailable()
		{
			return true;
		}

		// Token: 0x060013E4 RID: 5092 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void AnglerQuestChat(ref string description, ref string catchLocation)
		{
		}

		// Token: 0x060013E5 RID: 5093 RVA: 0x0000D858 File Offset: 0x0000BA58
		public virtual TagCompound Save()
		{
			return null;
		}

		// Token: 0x060013E6 RID: 5094 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void Load(TagCompound tag)
		{
		}

		// Token: 0x060013E7 RID: 5095 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void LoadLegacy(BinaryReader reader)
		{
		}

		// Token: 0x060013E8 RID: 5096 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void NetSend(BinaryWriter writer)
		{
		}

		// Token: 0x060013E9 RID: 5097 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void NetRecieve(BinaryReader reader)
		{
		}

		// Token: 0x060013EA RID: 5098 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void AddRecipes()
		{
		}

		// Token: 0x060013EB RID: 5099 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void OnCraft(Recipe recipe)
		{
		}

		// Token: 0x060013EC RID: 5100 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool PreDrawTooltip(ReadOnlyCollection<TooltipLine> lines, ref int x, ref int y)
		{
			return true;
		}

		// Token: 0x060013ED RID: 5101 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PostDrawTooltip(ReadOnlyCollection<DrawableTooltipLine> lines)
		{
		}

		// Token: 0x060013EE RID: 5102 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool PreDrawTooltipLine(DrawableTooltipLine line, ref int yOffset)
		{
			return true;
		}

		// Token: 0x060013EF RID: 5103 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PostDrawTooltipLine(DrawableTooltipLine line)
		{
		}

		// Token: 0x060013F0 RID: 5104 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void ModifyTooltips(List<TooltipLine> tooltips)
		{
		}

		// Token: 0x04001472 RID: 5234
		public bool projOnSwing;

		// Token: 0x04001473 RID: 5235
		public int bossBagNPC;
	}
}
